﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Public;
using BLL;

namespace QLNhanKhau
{
    public partial class frmMain : DevComponents.DotNetBar.Metro.MetroForm
    {
        public frmMain()
        {
            InitializeComponent();
        }

        private void frmMain_Load(object sender, EventArgs e)
        {
            // Gán DataSource bằng cách gọi phương thức tĩnh của lớp Business
            //dgvTonGiao.DataSource = TonGiaoBLL.getTonGiao();
        }

        private void ItemKhaiSinh_Click(object sender, EventArgs e)
        {
            if (this.MdiChildren.Count() > 0)
                return;
            frmKhaiSinh ks = new frmKhaiSinh();
            ks.MdiParent = this;
            ks.Show();
            ks.Location = new Point(0, 0);
        }

        private void ItemChuyenDen_Click(object sender, EventArgs e)
        {
            if (this.MdiChildren.Count() > 0)
                return;
            Point location = new Point(0, 0);
            frmChuyenDen cd = new frmChuyenDen();
            cd.Show();
            cd.MdiParent = this;
            cd.Location = location;
        }

        private void ItemTrongXa_Click(object sender, EventArgs e)
        {
            if (this.MdiChildren.Count() > 0)
                return;
            Point location = new Point(0, 0);
            frmChuyenDi cdi = new frmChuyenDi();
            cdi.Show();
            cdi.MdiParent = this;
            cdi.Location = location;
        }

        private void ItemKhaiTu_Click(object sender, EventArgs e)
        {
            if (this.MdiChildren.Count() > 0)
                return;
            Point location = new Point(0, 0);
            frmKhaiTu kt = new frmKhaiTu();
            kt.Show();
            kt.MdiParent = this;
            kt.Location = location;
        }

        private void ItemTachKhau_Click(object sender, EventArgs e)
        {
            if (this.MdiChildren.Count() > 0)
                return;
            Point location = new Point(0, 0);
            frmTachKhau tt = new frmTachKhau();
            tt.Show();
            tt.MdiParent = this;
            tt.Location = location;
        }

        private void ItemNgoaiXa_Click(object sender, EventArgs e)
        {
            if (this.MdiChildren.Count() > 0)
                return;
            Point location = new Point(0, 0);
            frmChuyenDin cdn = new frmChuyenDin();
            cdn.Show();
            cdn.MdiParent = this;
            cdn.Location = location;
        }

        private void ItemBaoCao_Click(object sender, EventArgs e)
        {
            if (this.MdiChildren.Count() > 0)
                return;
            Point location = new Point(0, 0);
            frmBaocao bc = new frmBaocao();
            bc.Show();
            bc.MdiParent = this;
            bc.Location = location;
        }

        private void ItemQuanTri_Click(object sender, EventArgs e)
        {
            if (this.MdiChildren.Count() > 0)
                return;
            Point location = new Point(0, 0);
            frmNguoiDung nd = new frmNguoiDung();
            nd.Show();
            nd.MdiParent = this;
            nd.Location = location;
        }

        private void frmMain_FormClosed(object sender, FormClosedEventArgs e)
        {
            Application.Exit();
        }

        private void ItemXemNhanKhau_Click(object sender, EventArgs e)
        {
            if (this.MdiChildren.Count() > 0)
                return;
            Point location = new Point(0, 0);
            frmNhanKhau nd = new frmNhanKhau();
            nd.Show();
            nd.MdiParent = this;
            nd.Location = location;
        }

       
    }
}
